Improve message with unspecified install target.
authorBrandon Sanderson <bas.bsanders@gmail.com>
Mon, 30 Nov 2015 18:26:47 +0000 (10:26 -0800)
committerBrandon Sanderson <bas.bsanders@gmail.com>
Mon, 30 Nov 2015 18:26:47 +0000 (10:26 -0800)
When the crate to install is unspecified, we should really inform users about
where they can install from (other than crates.io).  This makes the message mention --path
and --git so that people know they exist.

src/cargo/ops/cargo_install.rs
tests/test_cargo_install.rs

index f65490519749ca43f841008337768bd8ad257d88..dc02233809e63b2e7176c6f968a2a9236019864d 100644 (file)
@@ -56,7 +56,8 @@ pub fn install(root: Option<&str>,
         try!(select_pkg(RegistrySource::new(source_id, config),
                         source_id, krate, vers,
                         &mut |_| Err(human("must specify a crate to install from \
-                                            crates.io"))))
+                                            crates.io, or use --path or --git to \
+                                            specify alternate source"))))
     };
 
     let mut list = try!(read_crate_list(&root));
index 8ccc024aeba3e5dbd6b00c9544b8f50dc4f507ec..8a91c368f29550f314827b8713a384db279bd3a3 100644 (file)
@@ -122,7 +122,8 @@ could not find `foo` in `registry file://[..]` with version `0.2.0`
 test!(no_crate {
     assert_that(cargo_process("install"),
                 execs().with_status(101).with_stderr("\
-must specify a crate to install from crates.io
+must specify a crate to install from crates.io, or use --path or --git \
+to specify alternate source
 "));
 });